<template>
  <div>
    <div class="title">
      <el-row>
        <el-col :span="1" style="width: 50px;">
          <span style="color:#757575;">位置 : </span>
        </el-col>
        <el-col :span="20">
          <span class="hand"></span>
        </el-col>
        <el-col :span="20">
          <span class="hand textactive">待办任务(交付)</span>
        </el-col>
    
      </el-row>
    </div>
    <div class="posttable">
      <el-row type="flex" justify="center">
        <el-col :span="23" style="margin-bottom: 10px;">
          <div style="float: left;" >
            <!-- <el-radio-group v-model="radio" style="margin-top: 20px;" @change="radiochange">
              <el-radio :label="1">未推送 ({{nopushnum}})</el-radio>
              <el-radio :label="2">面试时间未反馈 ({{unfeedbacknum}})</el-radio>
              <el-radio :label="3">已推送简历 ({{pushednum}})</el-radio>
            </el-radio-group> -->
          </div>
          <div style='float: right'>
            <el-col>
              <el-row  style="margin-top: 11px;" class="btn" type="flex" justify="end">
                <el-col>
                  <el-input
                    size="small"
                    placeholder="请输入内容"
                    @keyup.enter.native="search"
                    v-model.trim='searchword'
                  >
          
                    <i slot="suffix" class="el-input__icon el-icon-search" style="cursor: pointer;"    @click="search"></i>
                  </el-input>
                </el-col>
              </el-row>
            </el-col>
          </div>
        </el-col>
      </el-row>
      <el-row>
        <el-col  style="color: #1198fe;">
          <el-row type="flex" justify="center">
            <el-col :span="23">
         
            </el-col>
          </el-row>
          <el-row type="flex" justify="center">
            <el-col :span="23" class="posttable2">
              <el-table
                class="table"
                ref="singleTable"
                highlight-current-row
                :data="tableData"
              >
                <el-table-column
                  prop='推送客户'
                  label="推送客户"
                >
                </el-table-column>
                <el-table-column
                  prop='需求编号'
                  label="需求编号"
                >
                </el-table-column>
                <el-table-column
                  prop="推送职位"
                  label="推送职位">
                </el-table-column>
                <el-table-column
                  prop="职位级别"
                  label="职位级别">
                </el-table-column>
                <el-table-column
                  prop="所属区域"
                  label="所属区域"
                >
                </el-table-column>
                <el-table-column
                  prop="姓名"
                  label="姓名">
            
                </el-table-column>
                <el-table-column
                  prop="毕业时间"
                  label="毕业时间"
                >
                </el-table-column>
                <el-table-column
                  label="出生年月"
                  prop="出生年月"
                >
                </el-table-column>
                <el-table-column
                  label="联系方式"
                  prop="联系方式"
                >
                </el-table-column>
                <el-table-column
                  prop="离职状态"
                  label="离职状态"
                >
                </el-table-column>
                <el-table-column
                  prop="期望薪资"
                  label="期望薪资"
                >
                </el-table-column>
                <el-table-column
                  prop="到岗时间"
                  label="到岗时间"
                >
                </el-table-column>
                <el-table-column
                  prop="推送人"
                  label="推送人"
                >
                </el-table-column>
              </el-table>
          
              <div class="pager">
            
                <el-pagination
                  @current-change="pagehandleCurrentChange"
                  :current-page.sync="currentPage"
                  :page-size="pagesize"
                  layout="total,prev, pager, next"
                  :total="totalcount"
                >
                </el-pagination>
              </div>
            </el-col>
          </el-row>
        </el-col>
      </el-row>
    </div>
  </div>

</template>

<script>
  import axios from 'axios'
  import qs from 'qs'
  export default {
    name: "tasktodojiaofu",
    data(){
      return{
        tableData: [],
        currentPage: 1,
        pagesize: 15,
        totalcount: null,
        searchword : '',
        radio : 1,
        nopushnum : '',
        unfeedbacknum : '',
        pushednum : ''
      }
    },
    created(){
      this.getTable1();
      //获取未推送、面试时间未反馈、已推送简历的数量
      axios.post(this.url + '/todaytask/countassistantnohandle').then(res => {
        this.unlogin(res.data.code);
        if(res.data.code == 200){
          // this.nopushnum = res.data.data.未推送;
          this.unfeedbacknum = res.data.data.面试时间未反馈;
          // this.pushednum = res.data.data.已推送简历;
        }
      })
    },
    methods:{
      //待办任务未推送的表格数据
      // getTable(){
      //   axios.post(this.url + '/todaytask/searchassistantnohandlenopush',qs.stringify({
      //     condition : this.searchword,
      //     pageNum: this.currentPage,
      //     pageSize: this.pagesize
      //   })).then(res => {
      //     this.unlogin(res.data.code);
      //     if(res.data.code == 200){
      //       this.tableData = res.data.data.list;
      //       this.totalcount = res.data.data.total;
      //     }
      //   })
      // },
      //待办任务面试时间未反馈
      getTable1(){
        axios.post(this.url + '/todaytask/searchassistantnohandlenointerviewtime',qs.stringify({
          condition : this.searchword,
          pageNum: this.currentPage,
          pageSize: this.pagesize
        })).then(res => {
          this.unlogin(res.data.code);
          if(res.data.code == 200){
            this.tableData = res.data.data.list;
            this.totalcount = res.data.data.total;
          }
        })
      },
      //已推送简历的数据
      // getTable2(){
      //   axios.post(this.url + '/todaytask/searchassistantnohandlefinishresume',qs.stringify({
      //     condition : this.searchword,
      //     pageNum: this.currentPage,
      //     pageSize: this.pagesize
      //   })).then(res => {
      //     this.unlogin(res.data.code);
      //     if(res.data.code == 200){
      //       this.tableData = res.data.data.list;
      //       this.totalcount = res.data.data.total;
      //     }
      //   })
      // },
      //搜索功能，区分了未反馈消息和待办任务的不同情况
      search(){
          this.currentPage = 1;
          this.getTable1()
         
      },
      //切换单选按钮
      // radiochange(val){
      //   this.searchword = '';
      //   this.currentPage = 1;
      //   if(val == 1){
      //     this.getTable()
      //   }else if(val == 2){
      //     this.getTable1()
      //   }else if(val == 3){
      //     this.getTable2()
      //   }
      // },
      pagehandleCurrentChange(val) {
        this.currentPage = val;
          this.getTable1()
      },
    },
    watch: {
      'searchword': function (val) {
        if(val == ''){
            this.currentPage = 1;
              this.getTable1()
          };
      }
    },
  }
</script>

<style scoped>
  .title {
    background-color: #fff;
    height: 40px;
    line-height: 40px;
    font-size: 14px;
    padding-left: 20px;
    margin-top: 6px;
    margin-bottom: 6px;
  }
  
  .posttable {
    min-height: 700px;
    background-color: #fff;
  }
  
  .pager {
    width: 100%;
    overflow: hidden;
    position: relative;
    margin-top: 10px;
    margin-bottom: 10px;
  }
  
  .el-pagination {
    margin-left: 50%;
    transform: translateX(-50%);
  }
  
  .textactive {
    color: #1099ff;
  }
  
  
</style>
